//
// Created by Administrator on 2025/9/4.
//

#include <algorithm>
#include <iostream>
#include <map>

#include <string>
#include <vector>

int main()
{
    // count the number of times each word occurs in the input
    std::map<std::string, size_t> word_count; // empty map from string to size_t
    std::vector<std::string> exclude = {
        "The", "But", "And", "Or", "An", "A",
        "the", "but", "and", "or", "an", "a"
    };
    std::string word;
    while (std::cin >> word)
        // count only words that are not in exclude
            if (std::find(exclude.begin(), exclude.end(), word) == exclude.end())
                ++word_count[word]; // fetch and increment the counter for word

    for (const auto& w : word_count) // for each element in the map
        // print the results
            std::cout << w.first << " occurs " << w.second
                << ((w.second > 1) ? " times" : " time") << std::endl;
}
